﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.SimpleFlow
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.SimpleFlow;

    public class MapForsfType : EntityMapping<sfType>
    {
        public MapForsfType()
        {
            Property(x => x.Code, map =>
            {
                map.Length(40);
            });

            Property(x => x.IsFree, map =>
            {
            });

            Property(x => x.Name, map =>
            {
                map.Length(200);
            });

            Property(x => x.Name, map =>
            {
                map.Length(200);
            });

            Bag(x => x.Records, map =>
            {
                map.Key(keyMapper => keyMapper.Column("TypeID"));
            }, rel => rel.OneToMany());

            Bag(x => x.Steps, map =>
            {
                map.Key(keyMapper => keyMapper.Column("TypeID"));
            }, rel => rel.OneToMany());
        }
    }
}
